package com.findyou.config;

import org.apache.commons.dbutils.QueryRunner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.*;

import javax.sql.DataSource;

/**
 * @Title: ApplicationContext
 * @Author 贾金博
 * @Package com.findyou.config
 * @Date 2024/12/6 上午9:03
 * @description: 配置类
 */
@Configuration
@EnableAspectJAutoProxy
@Import(JDBCConfig.class)
@ComponentScan(basePackages = "com.findyou") // 别忘了扫描
public class ApplicationContext {

    @Autowired
    private DataSource dataSource;

    @Bean
    public QueryRunner queryRunner() {
        return new QueryRunner(dataSource); // 你也要进到数据库里面
    }
}
